package demo.using.threadPool;


/**
 * @author : GuoFei
 * @since : 2019/7/4 15:09
 */
public class TestMain2 {

    public static void main(String[] args) throws InterruptedException {
        ThreadBO thread = new ThreadBO();
        thread.showValue();
        thread.start();
        Thread.sleep(500);
        // 静态方法 获取线程是否中断的状态，不会清楚中断标记
//        boolean flag = ThreadBO.interrupted();
        // 获取线程是否中断的状态，会清楚线程中断的状态标记
//        boolean flag = thread.isInterrupted();
        // 中断线程，线程安全
        thread.interrupt();
        // 中断线程，线程不安全
//        thread.stop();
        while (thread.isAlive()) {}
        thread.showValue();
    }

}
